﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace devtm.Editor.Configuration.Merge
{
    public class MergeTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item != null && item is DiffItem)
            {
                var Item = item as DiffItem;
                var window = System.Windows.Application.Current.MainWindow;
                string key = "Merge" + Item.Type.ToString();

                return window.FindResource(key) as DataTemplate;

            }
            return null;
        }
    }
}